<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="翻译平台、翻译网站、找翻译、找人翻译、法语翻译、英语翻译、日语翻译、德语翻译、意大利语翻译、俄罗斯语、翻译人员、成都翻译、成都翻译员" />
<meta name="description" content="众译，助推翻译事业，选择最佳翻译人员，最迅速、最便捷的网络翻译平台。" />
<title>众译-可信赖的翻译平台-登陆页面</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/reset.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/css.css" />
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/jquery.css" />
<style type="text/css">
select {
	width: 100px;
	margin-top: 0px;
	margin-bottom: 0px;
	padding-top: 0px;
	padding-bottom: 0px;
}
.advance {
	display: none;
}
</style>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/config.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/citydata.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/industry.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/chooselanguage.js"></script>
<script type="text/javascript">
	$(function() {
		initLanguage("langTo", ''+$('#v_langTo').val());
		initLanguage("langFrom", ''+$('#v_langFrom').val());
		initExperience("experience", ''+$('#v_exp').val());
		initProvince("province", ''+$('#v_prov').val());
		initIndustry('goodAtArea', ''+$('#v_area').val());
		initType("goodAtType", ''+$('#v_ga').val());
		changeCity('province', 'city', ''+$('#v_cityc').val());
		replaceAllCity();
		replaceAllProvince();
		replaceLanguage();
		replaceExperience();
		replaceAllGoodAtType();
		replaceArea();
		resumeSearchCondition();
		$("#confirm_to_page").bind("click", topageClick);
		$("#advance").bind('click', advanceHandler);
		$("#search_btn").bind('click', search);
	});
	
	function replaceAllGoodAtType() {
		$(".type_txt").each(function (){
			$(this).text(getGoosAtTypeDesc($(this).text()));
		});
	}
	
	function advanceHandler() {
		$(".advance").each(function (index){
			$(this).toggle();
		});
	}
	
	function resumeSearchCondition() {
		
		var certified = ''+$('#v_certified').val();
		$(":radio[name='certified']").each(function (){
			if ($(this).val() == certified) {
				$(this).attr('checked', true);
			} else {
				$(this).attr('checked', false);
			}
		});
		
		certified = ''+$('#v_userType').val();
		$(":radio[name='userType']").each(function (){
			if ($(this).val() == certified) {
				$(this).attr('checked', true);
			} else {
				$(this).attr('checked', false);
			}
		});
		
		var exp = ''+$('#v_exp').val();
		$(":radio[name='experience']").each(function (){
			if ($(this).val() == exp) {
				$(this).attr('checked', true);
			} else {
				$(this).attr('checked', false);
			}
		});
	}
	
	function searchFilter(event) {
		search();
	}
	
	function topageClick(event) {
		var page = $("#to_page").val();
		try {
			page = parseInt(page);
		} catch (e) {
			page = 0;
		}
		
		if (isNaN(page) || page <= 0) {
			return;
		}
		topage(page);
	}
	
	function replaceArea() {
		$(".area_txt").each(function (index){
			var area_id = $(this).text().split(",");
			var txt = new Array();
			for (var i = 0 ; i < area_id.length; i++) {
				txt.push(findIndustry(area_id[i]));
			}
			$(this).text(txt.join(','));
		});
	}
	
	function replaceExperience() {
		$(".exp_txt").each(function (index){
			var exp_id = $(this).text();
			$(this).text(getExperience(exp_id));
		});
	}
	
	function replaceLanguage() {
		$(".lang_txt").each(function (index){
			var lang_id = $(this).text().split(",");
			var txt = new Array();
			for (var i = 0 ; i < lang_id.length; i++) {
				txt.push(getTranslate(lang_id[i]));
			}
			$(this).text(txt.join(","));
		});
	}
	
	function replaceAllCity() {
		$(".city_txt").each(function (index){
			var cid = $(this).text();
			var pid = $(this).next(".provice_txt").first().text();
			$(this).text(getCityDesc(pid, cid));
		});
	}
	
	function replaceAllProvince() {
		$(".provice_txt").each(function (index){
			var pid = $(this).text();
			$(this).text(getProvinceDesc(pid));
		});
	}
	
	function topage(page) {
		$("#page").val(page);
		search();
	}
	
	function search() {
		$("#search_form").submit();
	}
	
	function go(dir) {
		try {
			dir = parseInt(dir, 10);
			var page = $("#page").val();
			page = parseInt(page, 10);
			if (dir > -1) {
				page = page + 1;
			} else {
				page = page - 1;
			}
			if (page <= 0) {
				page = 1;
			}
			topage(page);
		} catch (e) {
			// 
		}
	}
</script>
</head>
<body>
<div class="layout">
<jsp:include page="/include/head/top.jsp" /> 
<jsp:include page="/include/head/top_nav.jsp" />
<%--
	<li><input type="radio" value="1" name="user.type" <s:if test="user.type == 1">checked="checked"</s:if>/><span>自由译员/口译者</span></li>
    <li><input type="radio" value="2" name="user.type" <s:if test="user.type == 2">checked="checked"</s:if>/><span>翻译公司</span></li>
    <li><input type="radio" value="3" name="user.type" <s:if test="user.type == 3">checked="checked"</s:if>/><span>需求客户</span></li>
 --%>
<div class="content">
<div class="col_left">
<div class="search_if">
<form action="" id="search_form" method="post" enctype="application/x-www-form-urlencoded">
	<table class="table_data bgee">
		<tbody>
		  <tr>
		    <td width="100" align="right">语言方向：</td>
		    <td>
				<select name="langFrom" id="langFrom">
					<option value="">请选择源语言</option>
				</select>
				»
				<select name="langTo" id="langTo">
					<option value="">请选择目标语言</option>
				</select>
		    </td>
		  </tr>
		     <tr>
		    <td align="right">翻译类别：</td>
		    <td>
			    <input type="radio" class="fl" name="userType" checked="checked" value="1"/>
			    <label>个人译员</label>
			    <input type="radio" class="fl" name="userType" value="2"/>
			    <label>翻译公司</label>
		    </td>
		  </tr>
		  <tr>
		    <td align="right">专业领域：</td>
		    <td><select name="goodAtArea" id="goodAtArea" style="width:100px;"></select></td>
		  </tr>
		  <tr>
		    <td align="right">擅长类型：</td>
		    <td id="goodAtType">
		    </td>
		  </tr>
		  <tr>
		    <td align="right">地区:</td>
		    <td>
			    <select name="province" id="province" onchange="changeCity('province', 'city');">
					<option>四川省</option>
				</select>
			    <select name="city" id="city">
					<option>成都</option>
				</select>
		    </td>
		  </tr>
		   <tr>
		    <td align="right">资质:</td>
		    <td><input name="certified" class="fl" type="radio" value="on"/><label>要求有证书</label><input class="fl" name="certified" type="radio" value="off"/><label>无要求</label></td>
		  </tr>
	     <tr>
		    <td align="right">翻译等级:</td>
		    <td>
			    <input type="radio" class="fl" name="experience" value="0"/><label>初级</label>
			    <input type="radio" class="fl" name="experience" value="3"/><label>中级</label>
			    <input type="radio" class="fl" name="experience" value="7"/><label>高级</label>
		    </td>
		  </tr>
		    <tr>
		    <td align="right"><input name="page" id="page" type="hidden" value="<s:property value='page'/>"/></td>
		    <td><input type="button" class="search_btn" value="" id="search_btn"/></td>
		  </tr>
		</tbody>
	</table>
</form>
<div class="clear"></div>
    </div>
<div class="transer">
<h1>翻译人才库</h1>
<s:iterator value="pageData" var="item">
<dl>
      <dt>
          <ul>
              <li><a href="#"><img alt="" src="<%=request.getContextPath() %>/images/user_pic/user_01.jpg"/></a></li>
              <li><span><s:property value="#item.nikeName"/></span></li>
              <li><span class="city_txt"><s:property value="#item.city"/></span>，<span class="provice_txt"><s:property value="#item.provice"/></span></li>
              <li><span>等级：</span><span class="stars_<s:property value="#item.averagePoint"/>"></span></li>
          </ul>
      </dt>
          <dd><span class="btitle">熟悉领域：</span><span class="area_txt"><s:property value="#item.goodAtArea"/></span></dd>
          <dd><span class="btitle">擅长类型：</span><span class="type_txt"><s:property value="#item.goodAt"/></span></dd>
          <dd><span class="btitle">翻译类别：</span>
	          <span>
	          	<s:if test="#item.type == 1">
	          		自由译员/口译者
	          	</s:if>
	          	<s:elseif test="#item.type == 2">
	          		翻译公司
	          	</s:elseif>
	          	<s:else>
	          		需求客户
	          	</s:else>
	          </span>
          </dd>
          <dd>
          <span class="chtranser"><a href="<%=request.getContextPath()%>/search/transer/<s:property value='#item.id'/>" target="_blank">查看详情</a></span>
          <span class="btitle">母语：</span><span class="lang_txt"><s:property value="#item.nativeLang"/> </span>
          </dd>
          <dd class="clear"></dd>
 </dl>
</s:iterator>
<input type="hidden" name="v_langFrom" id="v_langFrom" value="<s:property value='langFrom'/>"/>
<input type="hidden" name="v_langTo" id="v_langTo" value="<s:property value='langTo'/>"/>
<input type="hidden" name="v_area" id="v_area" value="<s:property value='goodAtArea'/>"/>
<input type="hidden" name="v_ga" id="v_ga" value="<s:property value='goodAt'/>"/>
<input type="hidden" name="v_exp" id="v_exp" value="<s:property value='experience'/>"/>
<input type="hidden" name="v_prov" id="v_prov" value="<s:property value='province'/>"/>
<input type="hidden" name="v_cityc" id="v_cityc" value="<s:property value='city'/>"/>
<input type="hidden" name="v_certified" id="v_certified" value="<s:property value='certified'/>"/>
<input type="hidden" name="v_userType" id="v_userType" value="<s:property value='userType'/>"/>
</div>
<div class="page">
<span>
<s:if test="%{page <= 1}">
	<a href="javascript:void(0)" class="disable">上一页</a>
</s:if>
<s:else>
	<a href="javascript:go('-1')">上一页</a>
</s:else>

<s:if test="totalPage <= 5">
	<s:iterator var="i" value="{1...totalPage}">
		<s:if test="i == page">
			<b>i</b>
		</s:if>
		<s:else>
			<a href="#">i</a>
		</s:else>
	</s:iterator>
</s:if>
<s:else>
	<s:if test="%{page <= 5}">
		<s:iterator var="c_page" value="{1,2,3,4,5}">
			<s:if test="#c_page == page">
				<b><s:property value="#c_page"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#c_page"/>')"><s:property value="#c_page"/></a>
			</s:else>
		</s:iterator>
		<b>......</b>
		<a href="javascript:topage('<s:property value="totalPage"/>')"><s:property value="totalPage"/></a>
	</s:if>
	<s:elseif test="%{page > 5 && totalPage - page > 3}">
		<a href="javascript:topage('1')">1</a>
		<a href="javascript:topage('2')">2</a>
		<b>......</b>
		<s:iterator var="c_page" value="{page - 2, page -1, page, page + 1, page + 2}">
			<s:if test="#c_page == page">
				<b><s:property value="#c_page"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#c_page"/>')"><s:property value="#c_page"/></a>
			</s:else>
		</s:iterator>
		<b>......</b>
		<a href="javascript:topage('<s:property value="totalPage"/>')"><s:property value="totalPage"/></a>
	</s:elseif>
	<s:else>
		<a href="javascript:topage('1')">1</a>
		<a href="javascript:topage('2')">2</a>
		<b>......</b>
		<s:iterator var="c_page" value="{totalPage - 3, totalPage - 2, totalPage - 1, totalPage}">
			<s:if test="#c_page == page">
				<b><s:property value="#c_page"/></b>
			</s:if>
			<s:else>
				<a href="javascript:topage('<s:property value="#c_page"/>')"><s:property value="#c_page"/></a>
			</s:else>
		</s:iterator>
	</s:else>
</s:else>

<s:if test="%{page == 0 || page >= totalPage}">
	<a href="javascript:void(0)" class="disable">下一页</a>
</s:if>
<s:else>
	<a href="javascript:go('1')">下一页</a>
</s:else>
</span>
<span style="font-size:12px;">
共<s:property value="totalPage"/>页 
到第<input type="text" name="to_page" id="to_page" style="width:22px;"/>页 
<input type="button" id="confirm_to_page" name="confirm_to_page" value="确定"/>
</span> 
</div>
</div>
<div class="col_right">
<dl class="category">
	<dt>快速翻译种类</dt>
	<dd><a href="#">英语翻译</a></dd>
	<dd><a href="#">日语翻译</a></dd>
	<dd><a href="#">法语翻译</a></dd>
	<dd><a href="#">德语翻译</a></dd>
	<dd><a href="#">意大利语翻译</a></dd>
	<dd><span><a href="#">更多&gt;&gt;</a></span></dd>
</dl>
</div>
</div>
<jsp:include page="/include/foot/foot.jsp" />
</div>
</body>
</html>